Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace match with if/else logic to restore compatiibility with earlier Python versions #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sjoerd-bouma
Copy link

The __init__.py currently uses the match statement, which was introduced only in Python 3.10. Unfortunately, this means pygdsm is incompatible with earlier Python versions, in particular on clusters etc. where upgrading may not be straightforward. As far as I could tell, the match statement was in fact the only source of incompatibility with older Python versions, so here my suggestion to replace it with if/else logic instead.

I have verified this works on a local Python 3.6 installation. I have also added the python_requires argument to the setup.cfg file, as I think this is how pip can tell which Python versions are supported. I suppose the version number also has to be bumped before this can be released, but I am not sure exactly how/if you would like to proceed from here : )

Copy link

what-the-diff bot commented Jun 25, 2024

PR Summary

  • Enhanced Compatibility with Older Python Versions
    A change was made in the code base of the program to swap out newer "match" statements for more traditional "if-elif" statements. This ensures that the package is usable even for those using older versions of Python programming language.

  • Explicit Python Version Requirements
    A new field was introduced in the configuration file which explicitly states that for the package to work smoothly, a Python version of 3.6 or higher is needed. This takes the guesswork out of determining which versions are compatible with our software.

  • Extended Language Support in Metadata
    We've updated the 'metadata' - essentially the package's 'label' so to speak - to include Python version support for 3.6 through to 3.9. This means our package is now officially stated to work with more recent versions of Python and can reached a broader user base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant